home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / ifl / TIFFOpen.z / TIFFOpen
Text File  |  1998-10-20  |  17KB  |  263 lines

  1.  
  2.  
  3.  
  4. TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      TIFFOpen, TIFFFdOpen, TIFFClientOpen - open a TIFF file for reading or
  10.      writing
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttiiiiffffffffiiiioooo....hhhh>>>>
  14.      TTTTIIIIFFFFFFFF**** TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((ccccoooonnnnsssstttt cccchhhhaaaarrrr**** ffffiiiilllleeeennnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** mmmmooooddddeeee))))
  15.      TTTTIIIIFFFFFFFF**** TTTTIIIIFFFFFFFFFFFFddddOOOOppppeeeennnn((((ccccoooonnnnsssstttt iiiinnnntttt ffffdddd,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** ffffiiiilllleeeennnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** mmmmooooddddeeee))))
  16.      ttttyyyyppppeeeeddddeeeeffff ttttssssiiiizzzzeeee____tttt ((((****TTTTIIIIFFFFFFFFRRRReeeeaaaaddddWWWWrrrriiiitttteeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttddddaaaattttaaaa____tttt,,,, ttttssssiiiizzzzeeee____tttt))));;;;
  17.      ttttyyyyppppeeeeddddeeeeffff ttttooooffffffff____tttt ((((****TTTTIIIIFFFFFFFFSSSSeeeeeeeekkkkPPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttooooffffffff____tttt,,,, iiiinnnntttt))));;;;
  18.      ttttyyyyppppeeeeddddeeeeffff iiiinnnntttt ((((****TTTTIIIIFFFFFFFFCCCClllloooosssseeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt))));;;;
  19.      ttttyyyyppppeeeeddddeeeeffff ttttooooffffffff____tttt ((((****TTTTIIIIFFFFFFFFSSSSiiiizzzzeeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt))));;;;
  20.      ttttyyyyppppeeeeddddeeeeffff iiiinnnntttt ((((****TTTTIIIIFFFFFFFFMMMMaaaappppFFFFiiiilllleeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttddddaaaattttaaaa____tttt****,,,, ttttooooffffffff____tttt****))));;;;
  21.      ttttyyyyppppeeeeddddeeeeffff vvvvooooiiiidddd ((((****TTTTIIIIFFFFFFFFUUUUnnnnmmmmaaaappppFFFFiiiilllleeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttddddaaaattttaaaa____tttt,,,, ttttooooffffffff____tttt))));;;;
  22.      TTTTIIIIFFFFFFFF**** TTTTIIIIFFFFFFFFCCCClllliiiieeeennnnttttOOOOppppeeeennnn((((ccccoooonnnnsssstttt cccchhhhaaaarrrr**** ffffiiiilllleeeennnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** mmmmooooddddeeee,,,, tttthhhhaaaannnnddddlllleeee____tttt cccclllliiiieeeennnnttttddddaaaattttaaaa,,,,
  23.          TTTTIIIIFFFFFFFFRRRReeeeaaaaddddWWWWrrrriiiitttteeeePPPPrrrroooocccc rrrreeeeaaaaddddpppprrrroooocccc,,,, TTTTIIIIFFFFFFFFRRRReeeeaaaaddddWWWWrrrriiiitttteeeePPPPrrrroooocccc wwwwrrrriiiitttteeeepppprrrroooocccc,,,, TTTTIIIIFFFFFFFFSSSSeeeeeeeekkkkPPPPrrrroooocccc sssseeeeeeeekkkkpppprrrroooocccc,,,,
  24.          TTTTIIIIFFFFFFFFCCCClllloooosssseeeePPPPrrrroooocccc cccclllloooosssseeeepppprrrroooocccc,,,, TTTTIIIIFFFFFFFFSSSSiiiizzzzeeeePPPPrrrroooocccc ssssiiiizzzzeeeepppprrrroooocccc,,,, TTTTIIIIFFFFFFFFMMMMaaaappppFFFFiiiilllleeeePPPPrrrroooocccc mmmmaaaapppppppprrrroooocccc,,,,
  25.          TTTTIIIIFFFFFFFFUUUUnnnnmmmmaaaappppFFFFiiiilllleeeePPPPrrrroooocccc uuuunnnnmmmmaaaapppppppprrrroooocccc))))
  26.  
  27. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  28.      _T_I_F_F_O_p_e_n opens a TIFF file whose name is _f_i_l_e_n_a_m_e and returns a handle to
  29.      be used in subsequent calls to routines in _l_i_b_t_i_f_f.  If the open
  30.      operation fails, then zero is returned.  The _m_o_d_e parameter specifies if
  31.      the file is to be opened for reading (``r''), writing (``w''), or
  32.      appending (``a'') and, optionally, whether to override certain default
  33.      aspects of library operation (see below).  When a file is opened for
  34.      appending, existing data will not be touched; instead new data will be
  35.      written as additional subfiles.  If an existing file is opened for
  36.      writing, all previous data is overwritten.
  37.  
  38.      If a file is opened for reading, the first TIFF directory in the file is
  39.      automatically read (also see _T_I_F_F_S_e_t_D_i_r_e_c_t_o_r_y(3T) for reading directories
  40.      other than the first).  If a file is opened for writing or appending, a
  41.      default directory is automatically created for writing subsequent data.
  42.      This directory has all the default values specified in TIFF Revision 6.0:
  43.      _B_i_t_s_P_e_r_S_a_m_p_l_e=1, _T_h_r_e_s_h_H_o_l_d_i_n_g=bilevel art scan, _F_i_l_l_O_r_d_e_r=1 (most
  44.      significant bit of each data byte is filled first), _O_r_i_e_n_t_a_t_i_o_n=1 (the
  45.      0th row represents the visual top of the image, and the 0th column
  46.      represents the visual left hand side), _S_a_m_p_l_e_s_P_e_r_P_i_x_e_l=1,
  47.      _R_o_w_s_P_e_r_S_t_r_i_p=infinity, _R_e_s_o_l_u_t_i_o_n_U_n_i_t=2 (inches), and _C_o_m_p_r_e_s_s_i_o_n=1 (no
  48.      compression).  To alter these values, or to define values for additional
  49.      fields, _T_I_F_F_S_e_t_F_i_e_l_d(3T) must be used.
  50.  
  51.      _T_I_F_F_F_d_O_p_e_n is like _T_I_F_F_O_p_e_n except that it opens a TIFF file given an
  52.      open file descriptor _f_d.  The file's name and mode must reflect that of
  53.      the open descriptor.  The object associated with the file descriptor mmmmuuuusssstttt
  54.      ssssuuuuppppppppoooorrrrtttt rrrraaaannnnddddoooommmm aaaacccccccceeeessssssss.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                                                         PPPPaaaaggggeeee 1111
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))
  68.  
  69.  
  70.  
  71.      _T_I_F_F_C_l_i_e_n_t_O_p_e_n is like _T_I_F_F_O_p_e_n except that the caller supplies a
  72.      collection of functions that the library will use to do UNIX-like I/O
  73.      operations. The _r_e_a_d_p_r_o_c and _w_r_i_t_e_p_r_o_c are called to read and write data
  74.      at the current file position.  _s_e_e_k_p_r_o_c is called to change the current
  75.      file position a la _l_s_e_e_k(2).  _c_l_o_s_e_p_r_o_c is invoked to release any
  76.      resources associated with an open file.  _s_i_z_e_p_r_o_c is invoked to obtain
  77.      the size in bytes of a file.  _m_a_p_p_r_o_c and _u_n_m_a_p_p_r_o_c are called to map and
  78.      unmap a file's contents in memory; c.f.  _m_m_a_p(2) and _m_u_n_m_a_p(2).  The
  79.      _c_l_i_e_n_t_d_a_t_a parameter is an opaque ``handle'' passed to the client-
  80.      specified routines passed as parameters to _T_I_F_F_C_l_i_e_n_t_O_p_e_n.
  81.  
  82. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  83.      The open mode parameter can include the following flags in addition to
  84.      the ``r'', ``w'', and ``a'' flags.  Note however that option flags must
  85.      follow the read-write-append specification.
  86.  
  87.      llll    When creating a new file force information be written with Little-
  88.           Endian byte order (but see below).  By default the library will
  89.           create new files using the native CPU byte order.
  90.  
  91.      bbbb    When creating a new file force information be written with Big-
  92.           Endian byte order (but see below).  By default the library will
  93.           create new files using the native CPU byte order.
  94.  
  95.      LLLL    Force image data that is read or written to be treated with bits
  96.           filled from Least Significant Bit (LSB) to Most Significant Bit
  97.           (MSB).  Note that this is the opposite to the way the library has
  98.           worked from its inception.
  99.  
  100.      BBBB    Force image data that is read or written to be treated with bits
  101.           filled from Most Significant Bit (MSB) to Least Significant Bit
  102.           (LSB); this is the default.
  103.  
  104.      HHHH    Force image data that is read or written to be treated with bits
  105.           filled in the same order as the native CPU.
  106.  
  107.      MMMM    Enable the use of memory-mapped files for images opened read-only.
  108.           If the underlying system does not support memory-mapped files or if
  109.           the specific image being opened cannot be memory-mapped then the
  110.           library will fallback to using the normal system interface for
  111.           reading information.  By default the library will attempt to use
  112.           memory-mapped files.
  113.  
  114.      mmmm    Disable the use of memory-mapped files.
  115.  
  116.      CCCC    Enable the use of ``strip chopping'' when reading images that are
  117.           comprised of a single strip or tile of uncompressed data.  Strip
  118.           chopping is a mechanism by which the library will automatically
  119.           convert the single-strip [-tile] image to multiple strips [tiles],
  120.           each of which has about 8 Kilobytes of data.  This facility can be
  121.           useful in reducing the amount of memory used to read an image
  122.           because the library normally reads each strip [tile] in its
  123.  
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))
  134.  
  135.  
  136.  
  137.           entirety.  Strip chopping does however alter the apparent contents
  138.           of the image because when an image is divided into multiple strips
  139.           it looks as though the underlying file contains multiple separate
  140.           strips [tiles].  Finally, note that strip chopping is an optional
  141.           compile-time feature of the library; just because its use is enabled
  142.           by an application does not mean that it may be present in the
  143.           library.
  144.  
  145.      cccc    Disable the use of strip chopping when reading images.
  146.  
  147. BBBBYYYYTTTTEEEE OOOORRRRDDDDEEEERRRR
  148.      The TIFF specification (aaaallllllll vvvveeeerrrrssssiiiioooonnnnssss) states that compliant readers _m_u_s_t
  149.      _b_e _c_a_p_a_b_l_e _o_f _r_e_a_d_i_n_g _i_m_a_g_e_s _w_r_i_t_t_e_n _i_n _e_i_t_h_e_r _b_y_t_e _o_r_d_e_r.  Nonetheless
  150.      some software that claims to support the reading of TIFF images is
  151.      incapable of reading images in anything but the native CPU byte order on
  152.      which the software was written.  (Especially notorious are applications
  153.      written to run on Intel-based machines.)  By default the library will
  154.      create new files with the native byte-order of the CPU on which the
  155.      application is run.  This ensures optimal performance and is portable to
  156.      any application that conforms to the TIFF specification.  To force the
  157.      library to use a specific byte-order when creating a new file the ``b''
  158.      and ``l'' option flags may be included in the call to open a file; for
  159.      example, ``wb'' or ``wl''.
  160.  
  161. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  162.      Upon successful completion _T_I_F_F_O_p_e_n, _T_I_F_F_F_d_O_p_e_n, and _T_I_F_F_C_l_i_e_n_t_O_p_e_n
  163.      return a TIFF pointer.  Otherwise, NULL is returned.
  164.  
  165. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  166.      All error messages are directed to the _T_I_F_F_E_r_r_o_r(3T) routine.  Likewise,
  167.      warning messages are directed to the _T_I_F_F_W_a_r_n_i_n_g(3T) routine.
  168.  
  169.      """"%%%%ssss"""":::: BBBBaaaadddd mmmmooooddddeeee.  The specified _m_o_d_e parameter was not one of ``r''
  170.      (read), ``w'' (write), or ``a'' (append).
  171.  
  172.      %%%%ssss:::: CCCCaaaannnnnnnnooootttt ooooppppeeeennnn.  _T_I_F_F_O_p_e_n() was unable to open the specified filename
  173.      for read/writing.
  174.  
  175.      CCCCaaaannnnnnnnooootttt rrrreeeeaaaadddd TTTTIIIIFFFFFFFF hhhheeeeaaaaddddeeeerrrr.  An error occurred while attempting to read the
  176.      header information.
  177.  
  178.      EEEErrrrrrrroooorrrr wwwwrrrriiiittttiiiinnnngggg TTTTIIIIFFFFFFFF hhhheeeeaaaaddddeeeerrrr.  An error occurred while writing the default
  179.      header information for a new file.
  180.  
  181.      NNNNooootttt aaaa TTTTIIIIFFFFFFFF ffffiiiilllleeee,,,, bbbbaaaadddd mmmmaaaaggggiiiicccc nnnnuuuummmmbbbbeeeerrrr %%%%dddd ((((0000xxxx%%%%xxxx)))).  The magic number in the
  182.      header was not (hex) 0x4d4d or (hex) 0x4949.
  183.  
  184.      NNNNooootttt aaaa TTTTIIIIFFFFFFFF ffffiiiilllleeee,,,, bbbbaaaadddd vvvveeeerrrrssssiiiioooonnnn nnnnuuuummmmbbbbeeeerrrr %%%%dddd ((((0000xxxx%%%%xxxx)))).  The version field in the
  185.      header was not 42 (decimal).
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                                                                         PPPPaaaaggggeeee 3333
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))      IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll       TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT))))
  200.  
  201.  
  202.  
  203.      CCCCaaaannnnnnnnooootttt aaaappppppppeeeennnndddd ttttoooo ffffiiiilllleeee tttthhhhaaaatttt hhhhaaaassss ooooppppppppoooossssiiiitttteeee bbbbyyyytttteeee oooorrrrddddeeeerrrriiiinnnngggg.  A file with a
  204.      byte ordering opposite to the native byte ordering of the current machine
  205.      was opened for appending (``a'').  This is a limitation of the library.
  206.  
  207. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  208.      _l_i_b_t_i_f_f(3T), _T_I_F_F_C_l_o_s_e(3T)
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.                                                                         PPPPaaaaggggeeee 4444
  259.  
  260.  
  261.  
  262.